#include <bits/stdc++.h>

using namespace std;
const size_t MAXN = 1'0001LL;
char matrix[MAXN][MAXN];
int n, m;
char intTochar[4] = {'.', '+', 'x', '*'};
vector<vector<int>> direction[4] = {
    {}, //
    {
        {-1, 0},
        {1, 0},
        {0, -1},
        {0, 1},
    }, // +
    {
        {-1, -1},
        {1, -1},
        {-1, 1},
        {1, 1},
    }, // x
    {
        {-1, 0},
        {1, 0},
        {0, -1},
        {0, 1},
        {-1, -1},
        {1, -1},
        {-1, 1},
        {1, 1}, // *
    }};
void search(char cType, int x, int y)
{
    int iType = 0;
    for (int i = 0; i < 4; ++i)
    {
        if (intTochar[i] == cType)
        {
            iType = i;
        }
    }
    int oldType = matrix[x][y];
    matrix[x][y] = iType;
    int time = 0, nDir = direction[iType].size();
    auto &dirction = direction[iType];
    vector<vector<int>> curr(nDir, {x, y});
    vector<char> status(nDir, '.');
    /**
     * 如果该小飞镖碰撞到了标记则输出标记字符，
     * 如果该小飞镖出界则输出 o，
     * 如果该小飞镖未碰撞也未出界则输出 .。
     */
    bool f = true;
    while (f)
    {
        ++time;
        for (int i = 0; i < nDir; ++i)
        {
            int nx = curr[i][0] + dirction[i][0],
                ny = curr[i][1] + dirction[i][1];
            if (
                nx < 1 || nx > n ||
                ny < 1 || ny > m)
            {
                f = false;
                status[i] = 'o';
            }
            else if (matrix[nx][ny] != 0)
            {
                f = false;
                status[i] = intTochar[matrix[nx][ny]];
                matrix[nx][ny] = 0;
            }
            else
            {
                curr[i][0] = nx;
                curr[i][1] = ny;
            }
        }
    }
    cout << intTochar[oldType] << " " << time << " ";
    for (int i = 0; i < nDir; ++i)
    {
        cout << status[i];
        if (status[i] == '.')
        {
            matrix[curr[i][0]][curr[i][1]] = iType;
        }
    }
    cout << endl;
}

int main()
{
    int q;
    cin >> n >> m >> q;
    memset(matrix, 0, sizeof(char) * MAXN * MAXN);
    while (q--)
    {
        int x, y;
        char t;
        cin >> x >> y >> t;
        search(t, x, y);
    }

    // system("pause");
    return 0;
}
